<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var arr= [
        ["第1条帖子","a","第一条帖子...","写入五行四列的表格，将贴子数组"],
        ["第2条帖子","b","第二条帖子...","写入五行四列的表格，将贴子数组"],
        ["第3条帖子","c","第三条帖子...","写入五行四列的表格，将贴子数组"],
        ["第4条帖子","d","第四条帖子...","写入五行四列的表格，将贴子数组"],
        ["第5条帖子","e","第五条帖子...","写入五行四列的表格，将贴子数组"]
    ];
    var i=0,j=0;
    var tablewidth="500px";
    var tableheight="400px";
    document.write("<table border=1 width='"+ tablewidth +"' height='"+ tableheight +"'>");
    function creatList(arr){
        for(i=0;i<arr.length;i++)
        {
            document.write("<tr>");
            for(j=0;j<arr[i].length;j++){
                if(j==2){
                    arr[i][j]=arr[i][j].slice(0,5)+"...";
                }
                document.write("<td>");
                document.write(arr[i][j]);
                document.write("</td>");
            }
        document.write("</tr>");
        }
    }
    creatList(arr);
    document.write("</table>");

    
</script>
</html>